<template>

	<view class="content">

		<view class="header">
			<view :style="{height: systemBarHeight + 'px'}">
			</view>
			<view class="navbar">
				<image src="/static/xy/fh.png" mode="" @click="fh()"></image>
				<text>我的工资</text>
			</view>
		</view>

		<view class="salary">
			<view class="dy_salary">
				<view class="dy_nub">
					￥<text>8328.32</text>
				</view>
				<view class="dy_tit">
					<text>当月工资</text>
				</view>
			</view>

			<view class="salary_tab">
				<view class="salary_item">
					<text class="nmb1">￥8888</text>
					<text class="nmb2">上月工资</text>
				</view>
				<view class="shu">

				</view>
				<view class="salary_item">
					<text class="nmb1">￥8888</text>
					<text class="nmb2">累计工资</text>
				</view>
			</view>
		</view>

		<view class="list">
			<view class="list_item" v-for="(item,index) in salaryList" :key="index">
				<view class="item_top">
					<view class="item_top_lf">
						<image src="/static/jl/yuefen.png" mode=""></image>
						<text class="mocth">2025年2月份</text>
						<text class="starts1" v-if="item.starts==0">未发放</text>
						<text class="starts2" v-if="item.starts==1">已发放</text>
					</view>
					<view class="item_top_rg" @click="open(index)">
						<text>查看</text>
						<image src="/static/jl/ck3.png" mode=""></image>
					</view>
				</view>
				<view class="item_bom">
					<view class="bom_item">
						<text>应发：￥8888</text>
					</view>
					<view class="bom_item">
						<text>实发：￥8888</text>
					</view>
				</view>
			</view>
		</view>


		<view class="popup">
			<u-popup :show="show" :round="20" mode="bottom" @close="close" @open="open">
				<view class="details">
					<view class="top">
						<view class="guanbi">
							<image src="/static/xy/guanbi.png" mode="" @click="close()"></image>
						</view>

						<view class="salary_type">
							<view class="type_item">
								<view class="type1">
									￥<text>8888</text>
								</view>
								<view class="type2">
									<text>应发</text>
								</view>
							</view>
							<view class="type_item">
								<view class="type1">
									￥<text>8888</text>
								</view>
								<view class="type2">
									<text>实发</text>
								</view>
							</view>
						</view>
					</view>
					<view class="heng">

					</view>

					<view class="details_list">
						<scroll-view style="height: 850rpx;" :scroll-top="scrollTop" :show-scrollbar="false"
							scroll-y="true" class="scroll-Y" @scrolltoupper="upper" @scrolltolower="lower"
							@scroll="scroll">
							<view class="details_item" v-for="(item,index) in costList" :key="index">
								<view class="cost_tit">
									<text>{{item.tit}}</text>
								</view>

								<view class="cost_list">
									<view class="cost_item" v-for="(va,index) in item.list" :key="index">
										<view class="cost_item_tit">
											<text>{{va.tit}}</text>
										</view>
										<view class="cost_item_money">
											<text :style="{color:item.starts==true?'#FB4747':''}">{{va.money}}</text>
										</view>
									</view>
								</view>
							</view>
						</scroll-view>

					</view>
				</view>
			</u-popup>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				systemBarHeight: 0,
				show: false,
				salaryList: [{
						starts: 0
					},
					{
						starts: 1
					},

					{
						starts: 1
					}
				],

				costList: [{
						tit: '培训费',
						starts: false,
						list: [{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
						]
					},
					{
						tit: '提成',
						starts: false,
						list: [{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
						]
					},
					{
						tit: '扣款',
						starts: true,
						list: [{
								tit: '2025-1-10 介绍xxx报名',
								money: '-600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
						]
					},
					{
						tit: '补助',
						starts: false,
						list: [{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
							{
								tit: '2025-1-10 介绍xxx报名',
								money: '+600'
							},
						]
					},


				]
			}
		},
		mounted() {
			/* 手机顶部高度 */
			this.getSysteminfo()
		},
		methods: {
			/* 手机顶部高度 */
			getSysteminfo() {
				uni.getSystemInfo({
					success: res => {
						this.systemBarHeight = res.statusBarHeight;
					}
				});
			},
			fh() {
				uni.navigateBack({
					delta: 1
				})
			},
			close() {
				this.show = false
			},
			open(index){
				this.show=true
			}
		}
	}
</script>

<style lang="scss">
	::-webkit-scrollbar {

		width: 0;
		height: 0;
		color: transparent;

	}

	.content {
		width: 750rpx;
		height: 1624rpx;
		background: linear-gradient(180deg, #53DDA8 324rpx, #F0F0F0 32%);
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		background-size: 100% 100%;
		padding-bottom: 32rpx;
	}

	.navbar {
		height: 88rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;

		>image {
			width: 48rpx;
			height: 48rpx;
			position: absolute;
			left: 32rpx;
		}

		>text {
			font-family: PingFang SC, PingFang SC;
			font-weight: 600;
			font-size: 34rpx;
			color: #43484D;
		}
	}

	.salary {
		width: 92%;
		margin: 86rpx auto 0;

		height: 336rpx;
		background: linear-gradient(180deg, #D2FFEE 0%, #FFFFFF 100%);
		border-radius: 32rpx 32rpx 32rpx 32rpx;

		.dy_salary {
			display: flex;
			justify-content: center;
			flex-direction: column;
			padding-top: 58rpx;

			.dy_nub {
				font-family: DIN, DIN;
				font-weight: bold;
				font-size: 32rpx;
				color: #43484D;
				margin: auto;



				>text {
					font-family: DIN, DIN;
					font-weight: bold;
					font-size: 60rpx;
					color: #43484D;
				}
			}

			.dy_tit {
				margin-top: 8rpx;
				display: flex;
				justify-content: center;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 32rpx;
				color: #43484D;
			}
		}

		.salary_tab {
			display: flex;
			align-items: center;
			margin-top: 14rpx;

			.salary_item {
				width: 50%;

				display: flex;
				flex-direction: column;

				.nmb1 {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 32rpx;
					color: #43484D;
					margin: auto;
				}

				.nmb2 {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #43484D;
					margin: 4rpx auto 0;
				}
			}

			.shu {
				width: 0rpx;
				height: 46rpx;
				border: 2rpx solid rgba(0, 0, 0, 0.05);
			}
		}
	}

	.list {
		margin-top: 112rpx;

		.list_item {
			margin: 0 auto 32rpx;
			width: 93%;
			height: 194rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;

			.item_top {
				width: 90%;
				margin: auto;
				display: flex;
				align-items: center;
				padding-top: 32rpx;
				justify-content: space-between;

				.item_top_lf {
					display: flex;
					align-items: center;

					>image {
						width: 32rpx;
						height: 32rpx;

					}

					.mocth {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 30rpx;
						color: #43484D;
						margin-left: 12rpx;
						margin-right: 8rpx;
					}

					.starts1 {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #FEB745;
					}

					.starts2 {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #BDBDBD;
					}
				}

				.item_top_rg {
					display: flex;
					align-items: center;
					height: 32rpx;

					>image {
						width: 32rpx;
						height: 32rpx;
					}

					>text {
						height: 32rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #53DDA8;
						display: flex;
						align-items: center;
					}
				}
			}

			.item_bom {
				display: flex;
				width: 90%;
				height: 64rpx;
				background: #F7F7F7;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				margin: 24rpx auto 0;

				.bom_item {
					width: 50%;
					display: flex;
					align-items: center;
					justify-content: center;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 30rpx;
					color: #43484D;
				}
			}
		}
	}

	.details {
		height: 1110rpx;

		.heng {
			width: 750rpx;
			height: 16rpx;
			background: #F5F5F5;
			border-radius: 48rpx 48rpx 48rpx 48rpx;
		}

		.top {

			height: 232rpx;
			background: linear-gradient(180deg, #E8FFF6 0%, #FFFFFF 100%), #FFFFFF;
			border-radius: 20rpx 20rpx 0rpx 0rpx;

			.guanbi {
				width: 92%;
				margin: auto;
				padding-top: 24rpx;
				display: flex;
				justify-content: space-between;

				>image {
					width: 32rpx;
					height: 32rpx;
					margin-left: auto;
				}
			}

			.salary_type {
				width: 85%;
				margin: 24rpx auto 0;
				display: flex;
				justify-content: space-between;

				.type_item {
					width: 256rpx;
					height: 128rpx;
					background: #E9FFF6;
					border-radius: 32rpx 32rpx 32rpx 32rpx;
					border: 2rpx solid #53DDA8;
					display: flex;
					justify-content: center;
					flex-direction: column;

					.type1 {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 26rpx;
						color: #43484D;
						margin-left: auto;
						margin-right: auto;

						>text {
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 36rpx;
							color: #43484D;

						}
					}

					.type2 {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #43484D;
						margin: 8rpx auto 0;
					}
				}
			}
		}

		.details_list {
			height: 858rpx;
			padding-top: 32rpx;
			

			.details_item {
				width: 92%;
				margin: auto;
				padding-bottom: 32rpx;
				.cost_tit {
					margin-bottom: 18rpx;


					>text {
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						font-size: 32rpx;
						color: #43484D;
						background: #53DDA8;
						height: 24rpx;
						background-size: 100% 24rpx;
						text-align: bottom;
					}
				}

				.cost_list {


					.cost_item {
						display: flex;
						justify-content: space-between;
						align-items: center;

						margin-bottom: 10rpx;

						.cost_item_tit {
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 28rpx;
							color: #43484D;
						}

						.cost_item_money {
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							font-size: 32rpx;
							color: #32C037;
						}
					}
				}
			}
		}

	}
</style>